function Out_signal = Function_Create_Time_Domain_Signal(slMode, NFFT, N_pss_cazac, NSLRB, NRBsc, cpLenR, In_signal)
	 %Get time-domain signals (36.211, 9.9) 
	tmp = zeros(NFFT, 1);
	if slMode > 0 % sidelink mode
        tmp(NFFT/2-(N_pss_cazac-1)/2+1:NFFT/2+(N_pss_cazac-1)/2) = In_signal;
	elseif slMode == 0 % legacy LTE mode, not fully tested/supported yet
        ind = [(NFFT/2-(N_pss_cazac-1)/2:NFFT/2); (NFFT/2+2:(N_pss_cazac-1)/2+1)] ;
        tmp(ind) = In_signal;
    end
    % IFFT
	Tmp = ifft(ifftshift(tmp));
	% Normalize power:
	Tmp = NFFT/sqrt(NSLRB*NRBsc)*Tmp;
    % Add CP:
    Tmp = [Tmp(end-cpLenR+1:end); Tmp]; 
    % Shift by half subcarrier:
    Out_signal = Tmp.*exp(2i*pi*(-cpLenR:NFFT-1)'/NFFT/2);
    
end % create_time_domain_signal